//
//  ReceieveViewController.m
//  maocuhuiOASystem
//
//  Created by michael on 16/4/29.
//  Copyright © 2016年 czd. All rights reserved.
//
#import "dengjixqViewController.h"
#import "dengjiTableViewController.h"

#import "OADueInViewController.h"
#import "ReceieveViewController.h"
#import "FSWaitReceiveController.h"
@interface ReceieveViewController ()
@property (nonatomic,strong)NSArray* array;

@end

@implementation ReceieveViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"收文管理";
    // Do any additional setup after loading the view.
      _array = [NSArray arrayWithObjects:@"待收文件",@"已收文件",@"收文登记薄",nil];
     self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
   UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:nil action:nil];
    self.navigationItem.backBarButtonItem = barButtonItem;
     [self initview];

}
- (void)initview{
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
UIButton *button3 = [UIButton buttonWithType:UIButtonTypeCustom];

[button1 setBackgroundImage:[UIImage imageNamed:@"已收文件-ios"] forState:UIControlStateNormal];

[button2 setBackgroundImage:[UIImage imageNamed:@"待收文件-ios"] forState:UIControlStateNormal];

[button3 setBackgroundImage:[UIImage imageNamed:@"收文登记簿-ios"] forState:UIControlStateNormal];

float width = kScreenWidth-60;
button1.frame = CGRectMake(30, 200, width/3, 200);
button2.frame = CGRectMake(button1.right+10, button1.top, width*2/3-10, (button1.height-10)/2);
button3.frame = CGRectMake(button2.left, button2.bottom+10, button2.width, button2.height);
if ([self.string integerValue] !=0) {

 UILabel  *label= [[UILabel alloc]initWithFrame:CGRectMake(button3.width-15,0, 15, 15)];
    label.backgroundColor = [UIColor redColor];
    label.layer.cornerRadius = 7;
    label.layer.masksToBounds = YES;
    label.textAlignment = NSTextAlignmentCenter;
//    label.font = [UIFont boldSystemFontOfSize:2.0];
    label.textColor = [UIColor whiteColor];
    label.text = _string;
    [button2 addSubview:label];
    
UIFont *font = [UIFont boldSystemFontOfSize:(10)];
label.font = font;
if ([self.string integerValue] !=0) {
            label.hidden = NO;
        }else{
         label.hidden = YES;
        }
   
}
[button1 addTarget:self action:@selector(action1) forControlEvents:UIControlEventTouchUpInside];
[button2 addTarget:self action:@selector(action2) forControlEvents:UIControlEventTouchUpInside];
[button3 addTarget:self action:@selector(action3) forControlEvents:UIControlEventTouchUpInside];



[self.view addSubview:button1];
[self.view addSubview:button2];
[self.view addSubview:button3];
}

- (void)action1{
UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

 FSWaitReceiveController * dueInVC = (FSWaitReceiveController*)[storyBoard  instantiateViewControllerWithIdentifier:@"WaitReceive"];
 dueInVC.hidesBottomBarWhenPushed= YES;
    dueInVC.vcType = AlreadySignType;
        [self.navigationController pushViewController:dueInVC animated:YES];
NSLog(@"11");

}
- (void)action2{
NSLog(@"22");
UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

FSWaitReceiveController * dueInVC = (FSWaitReceiveController*)[storyBoard  instantiateViewControllerWithIdentifier:@"WaitReceive"];
 dueInVC.hidesBottomBarWhenPushed= YES;
    dueInVC.vcType = WaitForSignType;
        [self.navigationController pushViewController:dueInVC animated:YES];
}
- (void)action3{
UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
dengjiTableViewController *VC= [[dengjiTableViewController alloc]init];
 VC.hidesBottomBarWhenPushed= YES;

VC.method = @"swregbookPage";
[self.navigationController pushViewController:VC animated:YES];
NSLog(@"33");
}

// FSWaitReceiveController * dueInVC = (FSWaitReceiveController*)[self.storyboard instantiateViewControllerWithIdentifier:@"WaitReceive"];
//                                                  dueInVC.hidesBottomBarWhenPushed = YES;
//UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"AnJiMain" bundle:nil];
//
// OADueInViewController * dueInVC1 = (OADueInViewController*)[storyBoard instantiateViewControllerWithIdentifier:@"DueInVC"];
// 

//
//if (indexPath.row==0) {
//    dueInVC.vcType = WaitForSignType;
//        [self.navigationController pushViewController:dueInVC animated:YES];
//}
//if(indexPath.row==1) {
//    dueInVC.vcType = AlreadySignType;
//        [self.navigationController pushViewController:dueInVC animated:YES];
//}
//if(indexPath.row==2) {
//    dueInVC.vcType = SenderSinType;
//        [self.navigationController pushViewController:dueInVC animated:YES];
//
//}
//
//
//
//
//}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
